#pragma once

#include "glad/glad.h"
#include "glfw/glfw3.h"
#include "log.h"
#include "shader.h"
#include "model.h"
#include <map>
#include <memory>

namespace XXD
{
    class App
    {
    public:
        ~App();
        static App *getInstance();
        void run();
        void Draw();
        void setTitle(const char *title);
        void addModel(std::string name, std::shared_ptr<Model> Model);

        App(const App &) = delete;
        App &operator=(const App &) = delete;

    private:
        App();
        void processInput();
        static void framebuffer_size_callback(GLFWwindow *window, int width, int height);
        static void MouseButtonCallback(GLFWwindow *window, int button, int action, int mods);
        static void CursorPosCallback(GLFWwindow *window, double xpos, double ypos);
        static void ScrollCallback(GLFWwindow *window, double xoffset, double yoffset);

    private:
        int m_width = 800, m_height = 600;
        GLFWwindow *m_Window;
        std::map<std::string, std::shared_ptr<Model>> m_Models;
    };
}